package com.gxuwz.check.util;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.struts2.ServletActionContext;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;

public class ResultJson {
    public static void  R(JSONObject json){
            try {
                HttpServletResponse response = ServletActionContext.getResponse();
                String responseBody = JSON.toJSONString(json);
                PrintWriter printWriter = response.getWriter();
                printWriter.print(responseBody);
                printWriter.flush();
                printWriter.close();
            }catch (Exception e){
                e.printStackTrace();
            }

    }

}
